<template>
    <div>
        loading
    </div>
</template>
<script>
import {getGeolocation} from '@/utils/map'
export default {
    async created(){
        try{
            let positionData = await getGeolocation();
            console.log(JSON.stringify(positionData));
            localStorage.setItem('positionData',positionData.formattedAddress)
            this.$router.push('/main');
        }catch(e){
            console.log("失败",e);
            this.$router.push('/setPos')
        }
    }
}
</script>